package com.yonyou.rabbitmq.receiver;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

//@Component
public class WorkerReceiver2 {

    @RabbitListener(queuesToDeclare = @Queue("workerQueue"))
    @RabbitHandler
    public void receiveMessage(String msg) {
        System.out.println("WorkerReceiver2接收到消息：" + msg);
    }

}
